import * as Cesium from 'cesium'
import {GUI} from 'dat.gui';

function createModel(cesiumViewer) {
    // 创建GUI面板
    // const gui = new GUI();
    // const positionFolder = gui.addFolder('位置控制');
    // const params = {
    //     lng: 113.558982,
    //     lat: 41.448102,
    //     height: -10
    // };
    // // 绑定经纬度滑块
    // positionFolder.add(params, 'lng', -180, 180, 0.000001)
    //     .name('经度')
    //     .onChange((value) => {
    //         entity.position = Cesium.Cartesian3.fromDegrees(value, params.lat, params.height);
    //     });
    //
    // positionFolder.add(params, 'lat', -90, 90, 0.000001)
    //     .name('纬度')
    //     .onChange((value) => {
    //         entity.position = Cesium.Cartesian3.fromDegrees(params.lng, value, params.height);
    //     });
    //
    // positionFolder.add(params, 'height', -110, 10000, 1)
    //     .name('高度(m)')
    //     .onChange((value) => {
    //         entity.position = Cesium.Cartesian3.fromDegrees(params.lng, params.lat, value);
    //     });
    // positionFolder.open()
    cesiumViewer.entities.add({
        id: '小海子模型',
        position: Cesium.Cartesian3.fromDegrees(113.810786, 41.425215, -15),
        model: {
            uri: "/static/threeJs/model/小海子.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(113.810786, 41.425215, -15),
            new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
    cesiumViewer.entities.add({
        id: '三大顷西模型',
        position: Cesium.Cartesian3.fromDegrees(113.527339, 41.426199, -15),
        model: {
            uri: "/static/threeJs/model/三大顷西.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(113.527339, 41.426199, -15), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
    cesiumViewer.entities.add({
        id: '三大顷东模型',
        position: Cesium.Cartesian3.fromDegrees(113.558982, 41.448102, -10),
        model: {
            uri: "/static/threeJs/model/三大顷东.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(113.558982, 41.448102, -10), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
    cesiumViewer.entities.add({
        id: '七台镇东1模型',
        position: Cesium.Cartesian3.fromDegrees(113.616813, 41.544708, -10),
        model: {
            uri: "/static/threeJs/model/七台1.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(
            113.616813, 41.544708, -10), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
    cesiumViewer.entities.add({
        id: '七台镇东2模型',
        position: Cesium.Cartesian3.fromDegrees(113.593009, 41.532337, -15),
        model: {
            uri: "/static/threeJs/model/七台2.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(113.593009, 41.532337, 0,), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
    cesiumViewer.entities.add({
        id: '七台镇西模型',
        position: Cesium.Cartesian3.fromDegrees(113.514814, 41.540771, -5),
        model: {
            uri: "/static/threeJs/model/七台西.glb",
            scale: 100.0,
        },
        orientation: Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(
            113.514814, 41.540771, -5), new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(90), 0, 0))
    });
}

export {createModel};
